package com.crois.barrier.common.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Hou Ze Yu
 * @description
 * @date 2020/10/23
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class BarrierResponseEntity<T> {
    private String message;
    private int code;
    private T data;

    public BarrierResponseEntity(BarrierResponseStatus doorResponseStatus) {
        this.code = doorResponseStatus.getCode();
        this.message = doorResponseStatus.getMessage();
    }

    public BarrierResponseEntity(String message, int code) {
        this.message = message;
        this.code = code;
    }
}
